import { createApp } from 'vue'
import './assets/main.scss'
import App from './App.vue'
import router from './router/index'
import pinia from './store'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
//@ts-ignore
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
// svg-icons注册导入
import 'virtual:svg-icons-register'
//引入自定义插件对象:注册整个项目全局组件
import globalComponent from '@/components'
// 导入所有ElementPlus图标
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
const app = createApp(App)
import Antd from 'ant-design-vue'
import 'ant-design-vue/dist/reset.css'
app.use(router)
app.use(pinia)
app.use(Antd)

// 将所有图标进行全局注册
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

//引入全局样式
import '@/styles/index.scss'

//SvgIcon为svg公共组件
import SvgIcon from '@/components/SvgIcon/index.vue'
app.component('svg-icon', SvgIcon)
// 新增：导入组件

//安装自定义插件
app.use(globalComponent)

import mavonEditor from 'mavon-editor'
import 'mavon-editor/dist/css/index.css'
// use
app.use(mavonEditor)
// import 'highlight.js/styles/monokai-sublime.css'

app.use(ElementPlus, {
  locale: zhCn,
})

import 'highlight.js/styles/default.css'
app.mount('#app')
